import { PropType, defineComponent } from 'vue';
import { EditorController } from '@ibiz-template/runtime';
import { useNamespace } from '@ibiz-template/vue3-util';
import './ac-item.scss';

export const AcItemPlugin = defineComponent({
  name: 'IBizAcItemPlugin',
  props: {
    item: {
      type: Object as PropType<IData>,
      required: true,
    },
    controller: {
      type: EditorController,
      required: true,
    },
  },

  setup() {
    const ns = useNamespace('ac-item-plugin');
    return {
      ns,
    };
  },
  render() {
    return (
      <div class={this.ns.b()}>{this.item.srfmajortext || this.item.text}</div>
    );
  },
});
